//
//  VideoViewController.m
//  喜游迹
//
//  Created by niceDay on 16/1/12.
//  Copyright © 2016年 Leo_Lei. All rights reserved.
//

#import "VideoViewController.h"
#import <MediaPlayer/MediaPlayer.h>

@interface VideoViewController (){
    MPMoviePlayerController *playCtrl;
    NSURL *url;
}

@end

@implementation VideoViewController
- (void)viewDidLoad {
    [super viewDidLoad];
    
    url = [NSURL URLWithString:_model.videoName];
    playCtrl = [[MPMoviePlayerController alloc]initWithContentURL:url];
    playCtrl.controlStyle = MPMovieControlStyleDefault;
    
    [playCtrl prepareToPlay];
    
    [self.view addSubview:playCtrl.view];
    
    
    playCtrl.shouldAutoplay = YES;
    playCtrl.fullscreen = YES;
    playCtrl.controlStyle = MPMovieControlStyleNone;
    playCtrl.view.frame = self.view.bounds;
    
    [playCtrl prepareToPlay];
    
    playCtrl.useApplicationAudioSession = NO;
    
    [playCtrl play];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
